package cn.chinaflame.pagodas.entity;

import cn.chinaflame.pagodas.constant.Sysconst;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Objects;
import javax.persistence.*;
/**
 * @author created by lbq
 * @date 2018年1月4日 下午2:31:09
 **/
@Entity
//MySql版本 5.7.20对catalog是支持的 catalog表示的是数据库的名字（注意：老版本中schema表示的是数据库名）
@Table(name = "pa_product", schema = "pagoda", catalog = "pagoda")
public class PaProduct {
    private String id;
    private String name;
    private String productTypeId;
    private String productTypeName;
    private String itemId;
    private String itemName;
    private String areaId;
    private String areaName;
    private String positionId;
    private String positionName;
    private String positionIds;
    private String greetingsId;
    private Integer number;
    private BigDecimal price;
    private String state;
    private BigDecimal dayOne;
    private BigDecimal dayThree;
    private BigDecimal dayWeek;
    private BigDecimal dayMonth;
    private BigDecimal dayQuarter;
    private BigDecimal dayHalfYear;
    private BigDecimal dayYear;
    private String subCommodity;
    private String commodityType;
    private String facialPhoto;
    private String certificatePhoto;
    private String createtime;
    private String updatetime;
    private BigDecimal costPrice;
    private String description;
    private String praying;
    private String addTime;
    private String shelfTime;


    @Id
    @Column(name = "id", nullable = false, length = 20)
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "add_time", nullable = true)
    public String getAddTime() {
        return addTime;
    }

    public void setAddTime(String addTime) {
        this.addTime = addTime;
    }

    @Basic
    @Column(name = "position_ids", nullable = true)
    public String getPositionIds() {
        return positionIds;
    }

    public void setPositionIds(String positionIds) {
        this.positionIds = positionIds;
    }

    @Basic
    @Column(name = "cost_price", nullable = true)
    public BigDecimal getCostPrice() {
        return costPrice;
    }

    public void setCostPrice(BigDecimal costPrice) {
        this.costPrice = costPrice;
    }

    @Basic
    @Column(name = "shelf_time", nullable = true)
    public String getShelfTime() {
        return shelfTime;
    }

    public void setShelfTime(String shelfTime) {
        this.shelfTime = shelfTime;
    }

    @Basic
    @Column(name = "name", nullable = true, length = 30)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "product_type_id", nullable = true, length = 20)
    public String getProductTypeId() {
        return productTypeId;
    }

    public void setProductTypeId(String productTypeId) {
        this.productTypeId = productTypeId;
    }

    @Basic
    @Column(name = "item_id", nullable = true, length = 20)
    public String getItemId() {
        return itemId;
    }

    public void setItemId(String itemId) {
        this.itemId = itemId;
    }

    @Basic
    @Column(name = "area_id", nullable = true, length = 20)
    public String getAreaId() {
        return areaId;
    }

    public void setAreaId(String areaId) {
        this.areaId = areaId;
    }

    @Basic
    @Column(name = "position_id", nullable = true, length = 20)
    public String getPositionId() {
        return positionId;
    }

    public void setPositionId(String positionId) {
        this.positionId = positionId;
    }

    @Basic
    @Column(name = "greetings_id", nullable = true)
    public String getGreetingsId() {
        return greetingsId;
    }

    public void setGreetingsId(String greetingsId) {
        this.greetingsId = greetingsId;
    }

    @Basic
    @Column(name = "number", nullable = true)
    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    @Basic
    @Column(name = "price", nullable = true, precision = 2)
    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    @Basic
    @Column(name = "state", nullable = true, length = 1)
    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    @Basic
    @Column(name = "day_one", nullable = true, precision = 0)
    public BigDecimal getDayOne() {
        return dayOne;
    }

    public void setDayOne(BigDecimal dayOne) {
        this.dayOne = dayOne;
    }

    @Basic
    @Column(name = "day_three", nullable = true, precision = 0)
    public BigDecimal getDayThree() {
        return dayThree;
    }

    public void setDayThree(BigDecimal dayThree) {
        this.dayThree = dayThree;
    }

    @Basic
    @Column(name = "day_week", nullable = true, precision = 0)
    public BigDecimal getDayWeek() {
        return dayWeek;
    }

    public void setDayWeek(BigDecimal dayWeek) {
        this.dayWeek = dayWeek;
    }

    @Basic
    @Column(name = "day_month", nullable = true, precision = 0)
    public BigDecimal getDayMonth() {
        return dayMonth;
    }

    public void setDayMonth(BigDecimal dayMonth) {
        this.dayMonth = dayMonth;
    }

    @Basic
    @Column(name = "day_quarter", nullable = true, precision = 0)
    public BigDecimal getDayQuarter() {
        return dayQuarter;
    }

    public void setDayQuarter(BigDecimal dayQuarter) {
        this.dayQuarter = dayQuarter;
    }

    @Basic
    @Column(name = "day_half_year", nullable = true, precision = 0)
    public BigDecimal getDayHalfYear() {
        return dayHalfYear;
    }

    public void setDayHalfYear(BigDecimal dayHalfYear) {
        this.dayHalfYear = dayHalfYear;
    }

    @Basic
    @Column(name = "day_year", nullable = true, precision = 0)
    public BigDecimal getDayYear() {
        return dayYear;
    }

    public void setDayYear(BigDecimal dayYear) {
        this.dayYear = dayYear;
    }

    @Basic
    @Column(name = "description", nullable = true)
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Basic
    @Column(name = "praying", nullable = true)
    public String getPraying() {
        return praying;
    }

    public void setPraying(String praying) {
        this.praying = praying;
    }

    @Basic
    @Column(name = "sub_commodity", nullable = true)
    public String getSubCommodity() {
        return subCommodity;
    }

    public void setSubCommodity(String subCommodity) {
        this.subCommodity = subCommodity;
    }

    @Basic
    @Column(name = "commodity_type", nullable = true)
    public String getCommodityType() {
        return commodityType;
    }

    public void setCommodityType(String commodityType) {
        this.commodityType = commodityType;
    }

    @Basic
    @Column(name = "facial_photo", nullable = true)
    public String getFacialPhoto() {
        return facialPhoto;
    }

    public void setFacialPhoto(String facialPhoto) {
        this.facialPhoto = facialPhoto;
    }

    @Basic
    @Column(name = "certificate_photo", nullable = true)
    public String getCertificatePhoto() {
        return certificatePhoto;
    }

    public void setCertificatePhoto(String certificatePhoto) {
        this.certificatePhoto = certificatePhoto;
    }

    @Basic
    @Column(name = "createtime", nullable = true)
    public String getCreatetime() {
        return createtime;
    }

    public void setCreatetime(String createtime) {
        this.createtime = createtime;
    }

    @Basic
    @Column(name = "updatetime", nullable = true)
    public String getUpdatetime() {
        return updatetime;
    }

    public void setUpdatetime(String updatetime) {
        this.updatetime = updatetime;
    }

    public String getProductTypeName() {
        return productTypeName;
    }

    public void setProductTypeName(String productTypeName) {
        this.productTypeName = productTypeName;
    }

    public String getItemName() {
        return itemName;
    }

    public void setItemName(String itemName) {
        this.itemName = itemName;
    }

    public String getAreaName() {
        return areaName;
    }

    public void setAreaName(String areaName) {
        this.areaName = areaName;
    }

    public String getPositionName() {
        return positionName;
    }

    public void setPositionName(String positionName) {
        this.positionName = positionName;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        PaProduct ywProduct = (PaProduct) o;
        return Objects.equals(id, ywProduct.id) &&
                Objects.equals(name, ywProduct.name) &&
                Objects.equals(productTypeId, ywProduct.productTypeId) &&
                Objects.equals(itemId, ywProduct.itemId) &&
                Objects.equals(areaId, ywProduct.areaId) &&
                Objects.equals(positionId, ywProduct.positionId) &&
                Objects.equals(number, ywProduct.number) &&
                Objects.equals(price, ywProduct.price) &&
                Objects.equals(state, ywProduct.state) &&
                Objects.equals(dayOne, ywProduct.dayOne) &&
                Objects.equals(dayThree, ywProduct.dayThree) &&
                Objects.equals(dayWeek, ywProduct.dayWeek) &&
                Objects.equals(dayMonth, ywProduct.dayMonth) &&
                Objects.equals(dayQuarter, ywProduct.dayQuarter) &&
                Objects.equals(dayHalfYear, ywProduct.dayHalfYear) &&
                Objects.equals(dayYear, ywProduct.dayYear) &&
                Objects.equals(createtime, ywProduct.createtime) &&
                Objects.equals(updatetime, ywProduct.updatetime);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, name, productTypeId, itemId, areaId, positionId, number, price, state, dayOne, dayThree, dayWeek, dayMonth, dayQuarter, dayHalfYear, dayYear, createtime, updatetime);
    }
}
